﻿@{
    ViewBag.Title = "PosPriceEdit";
}
@section scripts
{  
    <script src="@Url.Content("~/Scripts/shared/share.js?v=")@ViewBag.version" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/shared/shown.js?v=")@ViewBag.version" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/Bill/Bill.js?v=")@ViewBag.version" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/common/export.js?v=")@ViewBag.version" type="text/javascript"></script> 
}

<ul id="popupMenu" class="mini-menu" style="display:none;">
        <li id="uncheck" iconCls="icon-unlock" onclick="myuncheckBill">终止调价</li>
        <li class="separator"></li>
        <li id="setprice" iconCls="icon-node" onclick="setPriceUnite">统一调价</li>
</ul>
<ul id="gridMenu" class="mini-contextmenu">              
    <li name="import" iconCls="icon-add" onclick="getImportDataPurch()">导入数据</li>  
    <li class="separator"></li>      
    <li name="export" iconCls="icon-node" onclick="exportbilldata()">导出数据</li>              
</ul>

<div class="mini-toolbar" style="padding:2px;border-top:0;border-left:0;border-right:0;">                
    <table width = "1000px;">
        <tr>
            <td width = "1000px;">
                <a class="mini-button" id="new" iconCls="icon-new" onclick="setNewBill" plain="true" visible="@ViewBag.save">新增</a>
                <a class="mini-button" id="save" iconCls="icon-save" onclick="saveBill" plain="true" visible="@ViewBag.save">保存</a>                
                <a class="mini-button" id="addrow" iconCls="icon-addnew" onclick="addRow" plain="true" visible="@ViewBag.save">增行</a>
                <a class="mini-button" id="delrow" iconCls="icon-remove" onclick="removeRow" plain="true" visible="@ViewBag.save">删行</a>                 
                 <a class="mini-button" id="modify" iconCls="icon-edit" onclick="mymodify" plain="true" visible="@ViewBag.save">改单</a>
                 <a class="mini-button" id="check" iconCls="icon-ok" onclick="mycheckBill" plain="true" visible="@ViewBag.check">审核</a>                   
                 <a class="mini-menubutton" plain="true" iconCls="icon-expand" menu="#popupMenu" visible="@ViewBag.save">选项</a>                 
                 <a class="mini-button" id="print" iconCls="icon-print" onclick="printdata" plain="true" visible="@ViewBag.print">打印</a>
                 <a class="mini-button" id="getdata" iconCls="icon-collapse" onclick="getBill" plain="true">浏览</a>
                 <span class="separator"></span>
                <a class="mini-button" id="close" iconCls="icon-close" onclick="CloseWindowBill" plain="true">关闭</a>
            </td>
        </tr>
    </table>                
</div>
<form id="form1" runat="server" method="post" style="height: 100%">
<div id = "DivHeader">
        <table>
            <tr>
                <td width ="80px" align="right">分店名称：</td>
                <td width ="190px">@Html.Partial("~/Views/Modular/LookupStockData.cshtml")</td>
                <td  width ="80px" align="right">开单日期：</td>
                <td width ="170px">    
                    <input name="FDate" class="mini-datepicker" style="width:170px;"/>
                </td>
                    <td width ="80px" align="right">单据编号：</td>
                <td width ="160px">    
                    <input name="FBillNo" class="mini-textbox" style="width:150px;" readonly="true"/>
                </td>
            </tr>
            <tr>
                <td align="right">调价类型：</td>
                <td >
                    <input id="AdjType" name="AdjType" class="mini-combobox" style="width:200px;" showNullItem="false" onvaluechanged="setType"
                            allowInput="false" align="left" value ="13" data ="comAdjType"/> 
                </td>
                <td align="right">开始时间：</td>
                <td >        
                    <input name="SPstdate" class="mini-datepicker" format="yyyy-MM-dd HH:mm:ss" style="width:170px;"/></td>
                <td align="right">    
                    单据状态：</td>
                <td >    
                    <input name="txtCheckFlag" class="mini-textbox" readonly="readonly" style="width:150px;"/>
                </td>
            </tr>
            <tr>
                <td align="right"></td>
                <td></td>
                <td align="right">结束时间：</td>
                <td ><input name="SPendate" class="mini-datepicker" format="yyyy-MM-dd HH:mm:ss" style="width:170px;"onvaluechanged="updateTime"/></td>
                <td align="right">备注：</td>
                <td ><input name="FRemark" class="mini-textbox" style="width:150px;"/></td>
            </tr>
        </table>
</div>
<div class="mini-fit">
        <div id="tabs1" class="mini-tabs" activeIndex="0" style="width:100%;height:92%;" plain="false">
            <div title="价格明细" >      
                    <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;" 
                            showPager = "false" showPageSize="false" showPageIndex="false" skipReadOnlyCell="true"
                            allowCellSelect="true" allowSortColumn = "false" allowCellEdit="true"showColumnsMenu="false"  
                            editNextOnEnterKey="true"  editNextRowCell="false" 
                            oncellcommitedit="onCellCommitEdit"  navEditMode="true"
                            fitColumns="false">
                        <div property="columns">            
                        <div type="checkcolumn" >选择</div>      
                        <div type="indexcolumn" width="35" headerAlign="center" >序号</div>
                        <div field="mFNumber" name="mFNumber" displayField = "mFNumber" width="100" headerAlign="center">商品编码
                        <input property="editor" class="mini-buttonedit" onbuttonclick = "onButtonEdit" onvaluechanged = "onValueChanged" style="width:100%;"/>
                        </div>  
                        <div field="mFName" name="mFName" width="120" headerAlign="center">商品名称</div>  
                        <div field="mFModel" name="mFModel" width="100" headerAlign="center">规格型号</div>
                        <div field="mFUnitName" name="mFUnitName" width="40" headerAlign="center">单位</div>
                        <div field="mFPrice" name="mFPrice" width="80" numberFormat="#,0.00" headerAlign="center" align="right">原价
                        </div>
                        <div field="mFNewPrice" name="mFNewPrice" width="80" numberFormat="#,0.00" headerAlign="center" align="right">新价
                            <input property="editor" class="mini-spinner" maxValue="99999999" style="width:100%;"changeOnMousewheel ="false" showbutton="false" increment ="0"/>
                        </div>
                        <div field="mFDifPrice" name="mFDifPrice" numberFormat="#,0.00" width="80" headerAlign="center" align="right" summaryType="sum">差价</div>
                        <div field="mFCode" name="mFCode" width="120" headerAlign="center">商品条码</div>
                        <div field="mFRemark" name="mFRemark" width="150" headerAlign="center" >备注
                            <input property="editor" class="mini-textbox" style="width:100%;"/>
                        </div>
                    </div>
                </div>
            </div>
            <div title="调价分店">             
                <table width = "1000px;">
                    <tr>
                        <td width = "1000px;">
                            <a class="mini-button" id="AddStock" iconCls="icon-addnew" onclick="AddStock" plain="true">新增</a>
                            <a class="mini-button" id="DelStock" iconCls="icon-remove" onclick="DelStock" plain="true">删行</a>
                        </td>
                    </tr>
                </table>

                <div id="datagrid2" class="mini-datagrid" style="width:100%;height:90%;" 
                    multiSelect="true" showPager = "false" showPageSize="false" showPageIndex="false" fitColumns="false">
                    <div property="columns">            
                        <div type="checkcolumn" ></div>      
                        <div type="indexcolumn" width="35" headerAlign="center" >序号</div>
                        <div field="FNumber" name="FNumber" width="150" headerAlign="center"> 分店编码</div>  
                        <div field="FName" name="FName" width="300" headerAlign="center">分店名称</div>  
                    </div>
                </div>
            </div>
        </div>        
        <div>
            <table>
                <tr>
                    <td width ="60px" align="right">制单人：</td>
                    <td width ="100px"><input name="FBiller" class="mini-textbox" readonly="readonly"style="width:100px;" /></td>
                    <td width ="60px" align="right">审核人：</td>
                    <td width ="100px"><input name="FChecker" class="mini-textbox" readonly="readonly"style="width:100px;"/></td>
                    <td width ="70px" align="right">审核日期：</td>
                    <td width ="190px"><input class="mini-datepicker" format="yyyy-MM-dd H:mm:ss" name="FCheckDate" style="width:190px;" readonly="readonly" /></td>
                    <td>
                        <input name="FReckonFlag" class="mini-hidden" />
                        <input name="FDataType" class="mini-hidden"/>
                        <input name="KInterID" class="mini-hidden"/>
                        <input name="FBillerID" class="mini-hidden" />
                        <input name="FCheckerID" class="mini-hidden" />
                        <input name="FDiscount" class="mini-hidden" value="100.00" minValue="0" maxValue="200"/>
                        <input name="FTax" class="mini-hidden"value="0.00"minValue="0" maxValue="200"/>
                    </td>
                </tr>
            </table>
        </div>
</div>
</form>

<script  type="text/javascript">
    var comAdjType = [{ "id": 13, "text": "零售调价" },
                       { "id": 14, "text": "会员调价" }]
    mini.parse();
    var form = new mini.Form("form1");
    var grid = mini.get("datagrid1");
    var grid2 = mini.get("datagrid2");

    var uID = parent.window.getSystemAppID();
    var uCode = parent.window.getSystemAppCode();
    var uName = parent.window.getSystemAppName();
    var AppID = parent.window.getSystemAppID();

    var id = getQueryString("billid");
    if (id != null) {
        mini.getbyName("KInterID").setValue(id);
    }
    var datatype = getQueryString("datatype");
    if (datatype != null) {
        mini.getbyName("FDataType").setValue(datatype);
    }
    mini.getbyName("FBiller").setValue(uName);
    LoadData();

    $(function () {
        var nowDate = new Date();
        if (mini.getbyName("SPstdate").getValue() == "")
            mini.getbyName("SPstdate").setValue(dateToStr(nowDate, 1));
        if (mini.getbyName("SPendate").getValue() == "")
            mini.getbyName("SPendate").setValue(dateToStr(nowDate, 3));
    });

    function setType() {
        datatype = mini.getbyName("AdjType").getValue();
        mini.getbyName("FDataType").setValue(datatype);
    }

    function updateTime() {
        var t = mini.getbyName("SPendate").getFormValue();
        t = t.replace('00:00:00', '23:59:59');
        mini.getbyName("SPendate").setValue(t);
    }

    function setNewBill() {
        NewBill();
        grid2.setData(null);
        var nowDate = new Date();
        mini.getbyName("SPstdate").setValue(dateToStr(nowDate, 1));
        mini.getbyName("SPendate").setValue(dateToStr(nowDate, 3));
        MyBillState(0);
    }

    function LoadData() {
        var minterid = mini.getbyName("KInterID").value;
        $.ajax({
            url: '../Pos/GetBillData',
            data: { mSystemAppID: AppID, mBillID: minterid, mDataType: datatype },
            dataType: 'text',
            async: false,
            success: function (text) {
                var dataR = mini.decode(text);
                grid.setData(dataR.datadetail);
                grid2.setData(dataR.datastock);
                if (dataR.datamaster.length > 0 && dataR.datadetail.length > 0) {
                    var mdata = dataR.datamaster[0];
                    form.setData(mdata);
                    mini.getbyName("FStockID").setValue(mdata.FStockID);
                    mini.getbyName("FStockID").setText(mdata.FStockNumber);
                    mini.getbyName("SPstdate").setValue(mdata.FStarTime);
                    mini.getbyName("SPendate").setValue(mdata.FEndTime);
                    mini.getbyName("AdjType").setValue(mdata.FDataType);
                    if (mdata.FCheckFlag == 1) {
                        BillState(2);
                    }
                    else {
                        BillState(1);
                    }
                    if (mdata.FState == 0) {
                        mini.getbyName("txtCheckFlag").setValue("已停止");
                    }
                }
                else if (dataR.datamaster.length > 0 && dataR.datadetail.length == 0) {
                    var mdata = dataR.datamaster[0];
                    mini.getbyName("FStockID").setValue(mdata.FStockID);
                    mini.getbyName("FStockID").setText(mdata.FStockNumber);
                    mini.getbyName("FStockName").setValue(mdata.FStockName);
                    mini.getbyName("AdjType").setValue(mdata.FDataType);

                }
                if ((mdata.KInterID == "0") || (mdata.KInterID == null)) {
                    setNewBill();
                    if (dataR.datastock.length > 0) {
                        mini.getbyName("FStockID").setValue(mdata.FStockID);
                        mini.getbyName("FStockID").setText(mdata.FStockNumber);
                    }
                }
            }
        });
    }

    function ExtraFunc(obj) {
        obj.mFNewPrice = obj.mFPrice;
        obj.mFDifPrice = obj.mFPrice - obj.mFNewPrice;
        return obj;
    }

    function MyBillState(flag) {
        switch (flag) {
            case 0:   //新增
                mini.get("AddStock").setEnabled(true);
                mini.get("DelStock").setEnabled(true);
                mini.get("setprice").setEnabled(true);
                grid.setAllowCellEdit(true);
                break;
            case 1:   //保存
                mini.get("AddStock").setEnabled(false);
                mini.get("DelStock").setEnabled(false);
                mini.get("setprice").setEnabled(false);
                grid.setAllowCellEdit(true);
                grid.accept();
                break;
            case 2:   //审核
                mini.get("AddStock").setEnabled(false);
                mini.get("DelStock").setEnabled(false);
                mini.get("setprice").setEnabled(false);
                grid.setAllowCellEdit(false);
                break;
            case 3:   //关帐
                mini.get("AddStock").setEnabled(false);
                mini.get("DelStock").setEnabled(false);
                mini.get("setprice").setEnabled(false);
                grid.setAllowCellEdit(false);
                break;
            case 4:   //修改后
                mini.get("AddStock").setEnabled(true);
                mini.get("DelStock").setEnabled(true);
                mini.get("setprice").setEnabled(true);
                grid.setAllowCellEdit(true);
                break;
        }
        BillState(flag);
    }

    function onCellCommitEdit(e) {
        var row = e.record;
        var total = 0;
        var qty = 0;
        var alltotal = 0; //合计金额,总计
        var mdisc = 100;
        if ((typeof (row.mFName) == "undefined") || (row.mFName == "")) {
            e.cancel = true;
            return;
        }
        if (typeof (row.mFNumber) == "undefined") {
            return;
        }
        mini.get("save").setEnabled(true);//编辑后保存按钮可用

        if (e.field == "mFNewPrice") {
            total = (e.value - row.mFPrice);
            total = total.toFixed(2);
            grid.updateRow(row, { mFDifPrice: total });
        }

        /*if (e.field == "mFDifPrice") {
            qty = (e.value + row.mFPrice);
            qty = qty.toFixed(2);
            if (qty < 0) {
                mini.alert("单价不可小于0！");
                e.value = (0 - row.mFPrice);
                qty = 0;
            }
            grid.updateRow(row, { mFNewPrice: qty });
        }*/
    }

    function checkValid() {
        var MainData = form.getData();
        if (MainData.FStockID.toString() == "") {
            mini.showTips({ content: "<b>保存失败</b> <br/>门店不能空值!", state: "danger", x: "center", y: "top", timeout: 5000 });
            return false;
        }
        return true;
    }

    function saveBill() {
        if (checkValid() == false) return;
        var MainData = form.getData();
        var cDate = mini.getbyName("FDate").getFormValue();
        var cDate1 = mini.getbyName("SPstdate").getFormValue();
        var cDate2 = mini.getbyName("SPendate").getFormValue();
        if (cDate1 > cDate2) {
            mini.showTips({ content: "开始时间不能大于结束时间！", state: "danger", x: "center", y: "top", timeout: 5000 });
            return;
        }
        var rCnt = grid.getData().length;
        var json = "[{";
        json = json + '"KInterID":' + MainData.KInterID + ",";
        json = json + '"FBillNo":' + '"' + MainData.FBillNo + '",';
        json = json + '"FStockID":' + MainData.FStockID + ",";
        json = json + '"FDate":' + '"' + cDate + '",';
        json = json + '"FDate1":' + '"' + cDate1 + '",';
        json = json + '"FDate2":' + '"' + cDate2 + '",';
        json = json + '"FDataType":' + MainData.FDataType + ",";
        json = json + '"FRemark":"' + MainData.FRemark + '",';
        var billerid = uID;
        json = json + '"FBillerID":"' + billerid + '",';
        json = json + '"FTBName":"AdjPrice",';
        var js = "";
        for (var i = 0; i < rCnt; i++) {
            if (i > 0)
                js = js + ",";
            var rs = grid.getRow(i);
            if (typeof (rs.mFNumber) == "undefined") continue;
            js = js + '{"mFItemID":' + rs.mFItemID + ",";
            var remark = typeof (rs.mFRemark) == "undefined" ? "" : rs.mFRemark;
            js = js + '"mFRemark":' + '"' + remark + '",';
            var mFNewPrice = typeof (rs.mFNewPrice) == "undefined" ? 0 : rs.mFNewPrice;
            js = js + '"mFNewPrice":' + mFNewPrice + ",";
            var price = typeof (rs.mFPrice) == "undefined" ? 0 : rs.mFPrice;
            js = js + '"mFPrice":' + price + ",";
            var mFDifPrice = typeof (rs.mFDifPrice) == "undefined" ? 0 : rs.mFDifPrice;
            js = js + '"mFDifPrice":' + mFDifPrice + ',';
            js = js + '"mFRowNo":0, "mFInterID":0';
            js = js + "}"
        }
        json = json + '"Details":[' + js + ']';
        json = json + "}]";
        if (json.length < 8) {
            mini.alert("没有要保存的数据！");
            return;
        }

        if (grid2.getData().length == 0) {
            var mstockid = MainData.FStockID;
            var mstocknumber = mini.getbyName("FStockID").getText();
            var mstockname = mini.getbyName("FStockName").getValue();
            var newRow = { stid: mstockid, stbm: mstocknumber, stmc: mstockname };
            grid2.addRow(newRow, grid2.getData().length);
        }

        var data2 = grid2.getData();
        var json2 = mini.encode(data2);
        grid.loading("保存中，请稍后......");
        $.ajax({
            url: "/Pos/SaveData",
            data: { billdata: json, stockdata: json2, FSystemAppID: parent.window.getSystemAppID() },
            type: "post",
            cache: false,
            success: function (txt) {
                var ret = mini.decode(txt);
                grid.unmask();
                if (ret.id != -1) {
                    mini.getbyName("KInterID").setValue(ret.id);
                    mini.getbyName("FBillNo").setValue(ret.FBillNo);
                    MyBillState(1);
                    mini.showTips({ content: "<b>保存成功</b>", state: "success", x: "center", y: "top", timeout: 3000 });
                }
                else {
                    mini.alert("错误信息:" + ret.Status);
                }
            },
            error: function (xhr) {
                grid.unmask();
                mini.alert("错误信息:" + xhr.responseText);
            }
        });
    }

    function AddStock() {
        mini.open({
            url: "../GetItem/multindex",
            title: "门店选择", width: 730, height: 460,
            onload: function () {
                var iframe = this.getIFrameEl();
                var data = { action: "new", sTbName: "StockInfo", sSearchKey: '' };
                iframe.contentWindow.SetData(data);
            },
            ondestroy: function (action) {
                if (action) {
                    for (var i = 0, l = action.length; i < l; i++) {
                        var rw = action[i];
                        if (typeof (rw.FItemID) != "undefined") {
                            var hFItemID = rw.FItemID;
                            var mFItemID = "";
                            for (var j = 0, m = grid2.getData().length; j < m; j++) {
                                var rs = grid2.getRow(j);
                                if (hFItemID == rs.stid) {
                                    mFItemID = rs.stid;
                                }
                            }
                            if (mFItemID == "") {
                                var newRow = { stid: rw.FItemID, FNumber: rw.FNumber, FName: rw.FName };
                                grid2.addRow(newRow, grid2.getData().length);
                            }
                        }
                    }
                }
            }
        });
    }


    function DelStock() {
        var rows = grid2.getSelecteds();
        if (rows.length > 0) {
            grid2.removeRows(rows, true);
        }
    }

    function getBill() {
        mini.open({
            url: "../Bill/FindAdjPrice",
            title: "查看单据", width: 900, height: 530,
            onload: function () {
                var iframe = this.getIFrameEl();
                var data = { BillKind: datatype };
                iframe.contentWindow.SetData(data);
            },
            ondestroy: function (action) {
                if (action) {
                    if ((action.KInterID == null) || (action.KInterID == "undefined")) return;
                    mini.getbyName("KInterID").setValue(action.KInterID);
                    LoadData();
                }
            }
        });
    }

    function mycheckBill() {
        var kid = mini.getbyName("KInterID").value;
        var mdatatype = mini.getbyName("FDataType").value;
        var jsonstr = '[{"KInterID":' + kid + ',"FSystemAppID":"' + parent.window.getSystemAppID() + '","FTBName":"AdjPrice"}]';
        $.post("CheckAdj", { json: jsonstr }, function (data) {
            var ret = mini.decode(data);
            if (ret.status == 1) {
                MyBillState(2);
                var nowDate = new Date();
                mini.getbyName("FChecker").setValue(uName);
                mini.getbyName("FCheckDate").setValue(nowDate);
                mini.showTips({ content: "<b>审核成功</b>", state: "success", x: "center", y: "top", timeout: 3000 });
            }
            else
                mini.alert("<b>审核失败,</b>" + ret.msg);
        });
    }

    function myuncheckBill() {
        if (mini.getbyName("FBillNo").getValue() == "") {
            mini.alert("没有要终止调价的单据编号！");
        }
        else {
            mini.confirm("确定要终止该单据的商品调价吗？", "提示",
                function (action) {
                    if (action == "ok") {
                        mysetuncheckBill();
                    }
                }
            );
        }
    }

    function mysetuncheckBill() {
        var kid = mini.getbyName("KInterID").value;
        var mdatatype = mini.getbyName("FDataType").value;
        var jsonstr = '[{"KInterID":' + kid + ',"FSystemAppID":"' + parent.window.getSystemAppID()
            + '","FDataType":"' + mdatatype + '","KInterIds":"' + "" + '"}]';
        $.ajax({
            url: "StopAdj",
            data: { Json: jsonstr },
            cache: false,
            success: function (txt) {
                var ret = mini.decode(txt);
                if (ret.status == 1) {
                    BillState(3);
                    mini.showMessageBox({
                        showModal: false,
                        width: 250,
                        title: "提示",
                        iconCls: "mini-messagebox-info",
                        message: ret.msg,
                        timeout: 3000,
                        x: "right",
                        y: "bottom"
                    });
                }
                else {
                    mini.showMessageBox({
                        showModal: false,
                        width: 250,
                        title: "提示",
                        iconCls: "mini-messagebox-info",
                        message: ret.error,
                        timeout: 3000,
                        x: "right",
                        y: "bottom"
                    });
                }
            },
            error: function (xhr) {
                mini.alert("异常:" + xhr.responseText);
            }
        });
    }


    function setPriceUnite() {
        mini.open({
            url: "../pos/SAdPriceUnite",
            title: "统一调价", width: 360, height: 250,
            onload: function () {
            },
            ondestroy: function (action) {
                if (action) {
                    var ret = mini.decode(action);
                    if (ret.id != -1) {
                        var mtype = ret.id;
                        var mUnite = ret.FUnite;
                        var mPrice = 0;
                        var mAmount = 0;
                        for (var j = 0, m = grid.getData().length; j < m; j++) {
                            var row = grid.getRow(j);
                            if (typeof (row.mFItemID) != "undefined") {
                                mPrice = row.mFPrice;
                                var mNewPrice = 0;
                                switch (parseInt(mtype)) {
                                    case 0:
                                        mNewPrice = parseFloat(mPrice) + parseFloat(mUnite);
                                        mAmount = parseFloat(mUnite);
                                        break;
                                    case 1:
                                        mNewPrice = parseFloat(mPrice) - parseFloat(mUnite);
                                        mAmount = -parseFloat(mUnite);
                                        break;
                                    case 2:
                                        mNewPrice = parseFloat(mPrice) * parseFloat(mUnite);
                                        mAmount = mNewPrice - mPrice;
                                        break;
                                }
                                mNewPrice = mNewPrice.toFixed(2);
                                grid.updateRow(row, { mFNewPrice: mNewPrice, mFDifPrice: mAmount });
                            }
                        }
                    }
                }
            }
        });
    }

    function printdata() {
        var grid = mini.get("datagrid1");
        var url = "../Report/PrintReport";
        mini.open({
            url: url,
            title: "打印", width: 1000, height: 700,
            onload: function () {
                var iframe = this.getIFrameEl();
                var NoneDisplayCol = [0, 1];
                iframe.contentWindow.InitalPrint(grid, NoneDisplayCol, parent.window.getSystemCompany() + "调价表");
            }
        });
    }

    function mymodify() {
        MyBillState(4);
        modify();
    }


</script>